package com.cumulus.ianerp.ian.util.verifyCode;

import java.awt.image.BufferedImage;
import java.io.OutputStream;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
/**
 * 验证码生成action
 * @author Ian
 * @date 2017-05-14
 */
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class VerifyCodeAction {
	
	
	private static VerifyCode vc =new VerifyCode();
	/**
	 * 生成验证码
	 * Ian
	 * @throws Exception 
	 */
	@RequestMapping("/createVerifyCode.action")
	public void createVerifyCode(HttpSession session,OutputStream out) throws Exception{
		BufferedImage image = vc.getImage();
		String vcText = vc.getText();
		session.setAttribute("verify", vcText);
		VerifyCode.output(image, out);;
	}

}
